package com.example.mybatis1.controller;

import com.example.mybatis1.model.Userinfo;
import com.example.mybatis1.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 23735
 * Date: 2023-03-02
 * Time: 23:09
 */

@Controller
//@RequestMapping("/user")
public class UserController {
//    @Autowired
    @Resource
    public UserService userService;
    @ResponseBody
    @RequestMapping("/getuserinfobyid")
    public Userinfo getUserinfoById(Integer id){
        if(id==null){
            return null;
        }
        return userService.getUserinfoById(id);
    }
}
